package com._集合;

import java.util.ArrayList;

public class StudentDmeo {
    public static void main(String[] args) {
        ArrayList<Student> list =new ArrayList<Student>();

        Student s1 = new Student("张三",18);
        Student s2 = new Student("李四",25);
        Student s3 = new Student("王五",22);
        Student s4 = new Student("赵二",21);

        list.add(s1);
        list.add(s2);
        list.add(s3);
        list.add(s4);

        for (int i = 0; i < list.size(); i++) {
            Student s= list.get(i);
            System.out.println(s.getName()+","+s.getSge());
        }

    }
}
